package com.xwh.week1;

public class Practice4 {
    public static void main(String[] args) {
        System.out.println(method());
    }

    public static int method() {
        int num = 0;

        for(int i = 100; i < 1000; ++i) {
            for(int j = 100; j < 1000; ++j) {
                if (method1(i * j)) {
                    num = num > i * j ? num : i * j;
                }
            }
        }

        return num;
    }

    public static boolean method1(int num) {
        int reserve = 0;

        for(int num1 = num; num1 > 0; num1 /= 10) {
            reserve = reserve * 10 + num1 % 10;
        }

        return reserve == num;
    }
}
